package org.dydl.dao.system.repository;

import java.util.List;

import org.dydl.model.system.DeliveryDetail;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface IDeliveryDetailRepository extends CrudRepository<DeliveryDetail, Integer>,JpaSpecificationExecutor<DeliveryDetail>{

	@Query(value = "SELECT * FROM deliverydetail WHERE DELIVERY_NOTE_NO =:deliveryNoteNo" ,nativeQuery = true)
	List<DeliveryDetail> getDetailList(@Param("deliveryNoteNo")String deliveryNoteNo);

	@Modifying
	@Query(value = "DELETE FROM deliverydetail WHERE DELIVERY_NOTE_NO =:deliveryNoteNo",nativeQuery = true)
    void deleteDetail(@Param("deliveryNoteNo")String deliveryNoteNo);
	
}
